package dp;

/**
 * @Author Lc
 * @Date 2023/8/27
 * @PackageName: dp
 * @ClassName: LeetCode518
 * @Description: 零钱兑换Ⅱ
 */

public class LeetCode518 {
    public int change(int amount, int[] coins) {
        int[] dp = new int[amount + 1];
        dp[0] = 1;
        for(int i = 0; i < coins.length; i++){
            for(int j = coins[i]; j <= amount; j++){
                dp[j] += dp[j-coins[i]];
            }
        }
        return dp[amount];
    }
}
